import request from '@/utils/request'

const carriageApi = {
  // 获取运费模板列表
  getCarriageList: (params) => {
    return request({
      url: '/trade/freight-template/page',
      method: 'GET',
      params
    })
  },
  // 获取运费模板详情
  getCarriageDetail: (id) => {
    return request({
      url: `/trade/freight-template/get?id=${id}`,
      method: 'GET'
    })
  },
  // 新增运费模板
  addCarriage: (data) => {
    return request({
      url: '/trade/freight-template/create',
      method: 'POST',
      data
    })
  },
  // 更新运费模板
  updateCarriage: (data) => {
    return request({
      url: '/trade/freight-template/update',
      method: 'PUT',
      data
    })
  },
  // 删除运费模板
  deleteCarriage: (id) => {
    return request({
      url: `/trade/freight-template/delete?id=${id}`,
      method: 'DELETE'
    })
  },
  // 删除计费配置
  deleteCarriageCharge: (id) => {
    return request({
      url: `/trade/freight-template/charge/delete?id=${id}`,
      method: 'DELETE'
    })
  },
  // 运费模板使用情况
  getGoodsList: (params) => {
    return request({
      url: '/product/spu/page',
      method: 'GET',
      params
    })
  },
}
export default carriageApi